package com.hzncc.flowable_diboot.vo;

import com.diboot.core.binding.annotation.BindDict;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.core.entity.Dictionary;
import com.diboot.core.vo.LabelValue;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.entity.Customer;
import com.hzncc.flowable_diboot.entity.SapCustomer;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * SAP客户 VO定义
 *
 * @author MyName
 * @version 1.0
 * @date 2024-06-05
 * Copyright © MyCorp
 */
@Getter
@Setter
@Accessors(chain = true)
public class SapCustomerListVO extends SapCustomer {
    private static final long serialVersionUID = 1580599435044208883L;
    /**
     * 客户分类 关联字典选项
     */
    @BindDict(
            type = "CUSTOMER_CATE",
            field = "cate"
    )
    private LabelValue cateLabel;

    /**
     * 客户性质 关联字典选项
     */
    @BindDict(
            type = "CUSTOMER_NATURE",
            field = "nature"
    )
    private LabelValue natureLabel;

    /**
     * 客户行业 关联字典选项
     */
    @BindDict(
            type = "SAPCustomrBusiness",
            field = "business"
    )
    private LabelValue businessLabel;

    /**
     * 国家 关联字典
     */
    @BindDict(
            type = "country",
            field = "country"
    )
    private LabelValue countryLabel;


    /**
     * 省份 关联字典
     */
    @BindField(entity = Dictionary.class,field = "itemName",condition = "this.province = item_value and description = this.country and type = 'province'")
    private String provinceLabel;


    /**
     * crm客户id 关联信息
     */

    @BindField(
            entity = Customer.class,
            field = "name",
            condition = "this.customer_id = id"
    )
    private String customerIdLabel;

    /**
     * 创建人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.create_by = id"
    )
    private String createByLabel;

    /**
     * 更新人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.update_by = id"
    )
    private String updateByLabel;

}